FIG. 15 is a block diagram showing one example of a conventional type of positioning control unit. In FIG. 15, the conventional type of positioning control unit comprises a servo motor 13 as the equipment to be controlled, an encoder 14 for detecting a position and a speed of the servo motor 13, a servo amplifier 11 for driving the servo motor 13, a motion control section 5 for transmitting a drive signal for driving the servo motor 13 to the servo amplifier 11, and a sequence control section 1 for transmitting a control signal to the motion control section 5 according to a preset sequence program.
The sequence control section 1 comprises a sequence program section 3 for storing therein a sequence program shown in FIG. 16, a control section 2 for generating a start signal or the like according to the sequence program stored in the sequence program section 3, and an interface section 4 for transmitting the start signal or the like generated in the control section 2 to the motion control section 5. The sequence program in FIG. 16 is an example of the program set by a user using a peripheral equipment such as a keyboard or the like.
The motion control section 5 comprises an interface section 8 for receiving the start signal or the like transmitted from the sequence control section 1 (precisely, the interface section 4), a motion program section 9 for storing therein a motion program as shown in FIG. 17 (indicated as G code which is generally used in a machine tool when a servo motor is driven), a control section 6 for generating a drive signal according to the start signal received in the interface section 8 as well as according to the motion program stored in the motion program section 9, and an interface section 10 for transmitting the drive signal generated in the control section 6 to the servo amplifier 11. The motion program in FIG. 17 is an example of the program set by a user using a peripheral equipment such as a keyboard or the like.
The servo amplifier 11 has an interface section 12 for receiving the drive signal transmitted from the motion control section 5 (precisely, the interface section 10), and drives the servo motor 13 according to the drive signal received in the interface section 12 as well as according to the position signal and speed signal detected in the encoder 14.
Operation of this conventional type of positioning control unit is described below. In the sequence control section 1, the control section 2 reads out the sequence program shown in FIG. 16 from the sequence program section 3. The control section 2 determines whether an operating condition in the sequence program holds or not. When it is determined that the operating condition holds, the control section 2 generates a program-number signal indicating a number of the motion program ("No. 1" herein) to be executed as well as generates a start signal, and transmits these signals to the interface section 4. The interface section 4 receives the program-number signal and the start signal transmitted from the control section 2 and transmits these signals to the motion control section 5 (precisely, the interface section 8).
Operation in the motion control section 5 is described below with reference to the flow charts in FIG. 18 and FIG. 19. As shown, in FIG. 18, the control section 6 in the motion control section 5 determines whether the interface section 8 has received a start signal or not. Especially in the interface section 8, a start flag indicating an ON/OFF state of the start signal is prepared, and when the start signal is received, this start flag is changed to an ON state. The control section 6 determines whether this start flag is in an ON state or not (step S1001). When it is determined in step S1001 that the start flag is not in the ON state, the processing in the flow chart in FIG. 18 is ended.
If it is determined in step S1001 that the start flag is in an ON state, it is determined whether an operation flag indicating an operating state of processing to be executed (in this case, processing according to an instruction of the previous sequence program) in the motion control section 5 is in an ON state or not (step S1002). When it is determined in step S1002 that the operation flag is not in an ON state, namely when the operation flag is in an OFF state, the motion control section 5 reads in a pro gram number indicated by a program-number signal received in the interface section 8, and selects the motion program indicating the program number (step S1003) With this operation, the start flag is changed to an OFF state and the operation flag is changed to an ON state (step S1004). The motion control section 5 executes the processing (describe later) according to the motion program selected in step S1003 (step S1005), and ends the processing in the flow chart in FIG. 18.
When it is determined in step S1002 that the operation flag is in an ON state, an error processing (step S1006) is executed and the processing in the flow chart in FIG. 18 is ended.
The processing in step S1005 in FIG. 18 is explained with reference to FIG. 19. Herein, it is assumed that a motion program number read in step S1003 is "No. 1" and the motion program with the motion program number "No. 1" shown in FIG. 17 is executed. The control section 6 in the motion control section 5 decodes the motion program shown in FIG. 17 as follows (step S1007).
______________________________________ G01 POINT-TO-POINT positioning operation X100. Position at a target position = 100 mm on the X axis F1000. Feed speed = 1000 mm/min ______________________________________
After the program is decoded by the control section 6, it transmits a drive signal indicating a positional instruction for positioning under the conditions of the target position=100 mm and the feed speed of 1000 mm/min especially to the servo amplifier 11 (precisely, the interface section 12) corresponding to the X-axis (step S1008). When the interface section 12 receives the drive signal, the servo amplifier 11 rotates the servo motor 13 up to the target position at the speed indicated by the received drive signal. The encoder 14 always detects the position of the servo motor 13, and transmits an operation-complete signal indicating completion of the operation in the servo motor 13, when the servo motor 13 reaches the target position, to the motion control section 5 through the interface section 12 in the servo amplifier 11. The control section 6 in the motion control section 5 confirms that the servo motor 13 has reached the target position by checking whether a operation-complete signal for this operation has been received or not (step S1009).
When it is determined in step S1009 that the motion control section 5 has detected the completion of the operation of the servo motor 13, the operation flag is changed to an OFF state (step S1010), and ends the processing in the flow chart in FIG. 19, namely the processing of the motion program. When it is determined in step S1009 that the motion control section did not detect the completion of the operation of the servo motor 13, the situation indicates that the motion program is operating, then the checking as to whether the operation is completed or not in step S1009 is repeated.
As described above, with this conventional type of positioning control unit, the specified motion program is executed as soon as the operational conditions showing the sequence program holds, and positioning by the servo motor is achieved according to the motion program.
FIG. 20 is a block diagram showing another example of the positioning control unit based on the conventional technology. In FIG. 20, the conventional type of positioning control unit comprises a servo motor 13 as the equipment to be controlled, an encoder 14 for detecting the position and the speed of the servo motor 13, an encoder 23 mounted on a drive shaft (not shown) for a conveyor for detecting the rotation speed of the drive shaft, a servo amplifier 11 for driving the servo motor 13, a motion control section 5 for transmitting a drive signal for driving the servo motor 13 to the servo amplifier 11, and a sequence control section 1 for transmitting a control signal to the motion control section 5 according to a preset sequence program.
The sequence control section 1 comprises a sequence program section 3 for storing therein a sequence program shown in FIG. 16, a control section 2 for generating a start signal or the like according to the sequence program stored in the sequence program section 3, and an interface section 4 for transmitting the start signal generated in the control section 2 to the motion control section 5.
The motion control section 5 comprises an interface section 8 for receiving the start signal transmitted from the sequence control section 1 (precisely, the interface section 4), a motion program section 9 for storing therein a motion program shown in FIG. 21 (indicated by G code which is generally used in a machine tool when a servo motor is driven), a control section 6 for generating a drive signal according to the start signal received in the interface section 8 as well as according to the motion program stored in the program section 9, an interface section 10 for transmitting the drive signal generated in the control section 6 to the servo amplifier 11, an interface section 24 for receiving a number of pulses according to the speed detected by the encoder 23, and a memory 7 for storing thereon a number of pulses or the like received in the interface section 24. The motion program in FIG. 21 is an example of the program set by a user using a peripheral equipment such as a keyboard or the like.
The servo amplifier 11 has an interface section 12 for receiving the drive signal transmitted from the motion control section 5 (precisely, the interface section 10), and drives the servo motor 13 according to the drive signal received in the interface section 12 as well as according to the position signal and speed signal detected in the encoder 14.
Operation of this conventional type of positioning control unit is described below. In the sequence control section 1, the control section 2 reads the sequence program shown in FIG. 16 from the sequence program section 3. The control section 2 determines whether an operating condition in the sequence program holds or not. When it is determined that the operating condition holds, the control section 2 generates a program-number signal indicating a number of the motion program ("No. 1" herein) to be executed as well as generates a start signal, and transmits these signals to the interface section 4. The inter face section 4 receives the program-number signal and the start signal transmitted from the control section 2 and transmits these signals to the motion control section 5 (precisely, the interface section 8).
As the operation in the motion control section 5 is the same as that shown in the flow charts in FIG. 18 and FIG. 19, their description is omitted herein. A concrete processing according to the motion program shown in FIG. 21 is described with reference to FIG. 22. Instep S1007 in FIG. 19, the control section 6 in the motion control section 5 decodes the motion program shown in FIG. 21 as follows.
______________________________________ G95 Feed speed changed to a value per 1 rev of a main shaft X100. Position at a target position = 100 mm on the X axis F10. Feed speed = 10 mm/rev ______________________________________
The control section 6 transmits, according to the motion program shown in FIG. 21, a drive signal indicating a positional instruction for positioning under the conditions of the target position=100 mm and the feed speed of 10 mm/rev to the servo amplifier 11 (precisely, the interface section 12) corresponding to the X-axis. When the interface section 12 receives the drive signal, the servo amplifier 11 rotates the servo motor 13 up to the target position at the speed indicated by the received drive signal.
While this rotational operation is being executed, the control section 6 in the motion control section 5 reads a number of pulses detected in the encoder 23 for a prespecified period of time (described as encoder-detection value hereinafter) from the interface section 24 (step S1101). This encoder-detection value indicates a rotational speed of a drive shaft for the conveyor or the like. The control section 6 writes the encoder-detection value in the memory 7 as current value (step S1102). Thus, a current time value indicates the latest encoder-detection value. Then, .DELTA.P is computed by subtracting the previous encoder-detection value (previous value) from the current value according to the expression described below (step S1103). EQU .DELTA.P=current value-previous value
Herein, .DELTA.P indicates a variation, namely a rate of acceleration and deceleration between the detected two rotational speeds (in this case, current value and the previous value), and is written in the memory 7 in the same manner as the current value.
Then, .DELTA.L is computed according to the expression described below using the .DELTA.P computed in step S1103, number of pulses per rev (has been written in the memory 7) as a prespecified reference, and a feed speed F (10 mm/rev) set in the motion program (step S1104). EQU .DELTA.L=F.times..DELTA.P/number of pulses per rev
Herein, .DELTA.P/number of pulses per rev indicates an increase or a decrease of the number of rev per prespecified period of time, and by multiplying the above value by the feed speed F set in the servo motor 13, a value .DELTA.L of increase/decrease of rotational speed for following the rotational speed of the drive shaft detected in the encoder 23 can be obtained.
The control section 6 transmits a signal indicating the .DELTA.L computed in step S1104 to the interface section 10 as an instruction value for the servo amplifier. The interface section 10 transmits the received .DELTA.L signal to the servo amplifier 11 (precisely, the interface section 12) (step S1105), and the servo amplifier 11 drives the servo motor 13 at the feed speed increased or decreased according to this .DELTA.L signal. With this operation, the rotational drive of the servo motor 13 in synchronism to the operational speed of a different driving system such as the drive shaft for the conveyor can be achieved.
After the processing in step S1105, the value indicating the current value is set as the previous value for the next processing (step S1106). The .DELTA.P, the current value, the previous value and the number of pulses per rev of the motor are stored in the memory 7 as shown in FIG. 23.
As described above, with this conventional type of positioning control unit, it is possible to achieve setting of a servo motor according to the motion program executed as soon as the operational condition indicated in the sequence program holds, and also a synchronous operation to the servo motor by changing a feed speed of the servo motor according to a servo-amplifier instruction value computed from the rotational speed (herein, number of pulses) of the drive shaft for a conveyor.
In the example of the conventional type of position control unit, however, when the processing (processing according to an instruction for the previous sequence program in this case) executed in the motion control section 5 is in operation, a start signal for starting the processing according to an instruction for a new sequence program can not be accepted and an error processing is executed. Accordingly, in order to start the processing according to an instruction for a new sequence program, when it is determined that the processing according to an instruction for the previous sequence program has ended, then only the processing of reading in a new sequence program is started anew, therefore, a plurality of sequence programs can not continuously be executed without any intermission.
Furthermore, if the start flag for starting the processing according to an instruction for a sequence program is always in an ON state, the processing according to an instruction for a new sequence program can not be executed.
In an another example of the conventional type of position control unit, a prespecified period of time is required for detecting rotational speed of a drive shaft for a conveyor, so that, for example, when the rotational speed in the drive shaft for a conveyor increases abruptly, a rotational position of the drive shaft after the prespecified period of time is also largely displaced. As the servo motor follows the speed after the occurrence of this large displacement, there occurs a divergence equivalent to this displacement. This divergence in the timing of the synchronous operation of the servo motor is varies depending on a variation rate in the rotational speed of the drive shaft for the conveyor, therefore, variations in a displacement rate may disadvantageously occur.
In addition, by fixedly setting the prespecified period of time for detecting the speed to a comparatively large value, sufficient speed variation can be obtained in the drive shaft of the conveyor, therefore, abrupt speed variations can not instantly be detected by making the prespecified period of time smaller.